package com.gh.cloud.product.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: guohao
 * @date: 2021-02-01 17:49
 **/
@RequestMapping("product")
@RestController
public class ProductController {

    @Value("${server.port}")
    private String port;

    @GetMapping(value = "/getProductById/{id}")
    public String getUserById(@PathVariable String id ){
        System.out.println("商品服务======================"+port);
//        try {
//            if("8102".equals(port)){
//                Thread.sleep(2000);
//            }else{
//                Thread.sleep(13000);
//            }
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        System.out.println("product/getProductById/"+id);
        System.out.println("商品服务======================"+port);
        return "port="+port;
    }
}
